package com.suse.warmstill.common.exception;

import com.suse.warmstill.common.enums.ResponseEnum;

/**
 * @author 黄靖
 * @author 2022-10-19 14:54
 * description:
 **/
public class SystemException extends RuntimeException {
    private int code;
    private String message;

    public SystemException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;

    }

    public SystemException(ResponseEnum responseEnum) {

        super(responseEnum.getMsg());
        this.code = responseEnum.getCode();
        this.message = responseEnum.getMsg();
    }


    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
